<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="Description" content="iamrifki.github.io" />
    <title>iamrifki.github.io</title>
    <link href="css/styles.css" rel="stylesheet" />
    <link href="css/display.css" rel="stylesheet" />
    <link rel="shortcut-icon" href="favicon.ico" />
  </head>

  <body>
    <div id="dbg">
      <pre id="out"></pre>
      <pre id="io"></pre>
      <pre id="stack"></pre>

      <button onclick="cpu(); debugData(); return false">CPU Step</button>
      <button onclick="requestStop ? run() : (requestStop=true); return false">
        Stop / Frame
      </button>
      <button onclick="runto();return false">Run To...</button>
    </div>

    <canvas
      id="display"
      width="160"
      height="144"
      onclick="runto(0x10000);"
      ondblclick="fullScreen(this)"
    ></canvas>

    <div style="width:480px;margin:auto">
      <input
        type="file"
        accept=".gb,.gbc"
        id="fileinput"
        onchange="openFile(event)"
      />

      <button onclick="requestStop? runto(0x10000) : requestStop=true">
        Run/Stop
      </button>
      <div style="display:inline-block;vertical-align:middle">
        <label style="display:block"
          ><input
            type="checkbox"
            checked="checked"
            onchange="limitFrameRate=this.checked"
            autocomplete="off"
          />Limit FPS</label
        >
        <label style="display:block"
          ><input
            type="checkbox"
            onchange="showFrameRate=this.checked"
            autocomplete="off"
          />Show FPS</label
        >
      </div>

      <br /><br />

      <a href="#" onclick="saveSram(this);">save .sav file</a> /
      <a
        href="#"
        onclick='document.getElementById("loadsav").click(); return false;'
        >load .sav file</a
      >
      <input
        type="file"
        id="loadsav"
        style="display:none"
        accept=".sav"
        onchange="loadSram(event)"
      />
      <button onclick="saveState(); return false">save state</button>
      <button onclick="loadState(); return false">load state</button>
      <button onclick="showDebug(!debugOn); return false">Debug</button>

      <br /><br />
      Keyboard controls are arrow keys, A, S, Enter and Shift. Doubleclick for
      fullscreen.

      <a href="#" onclick="gamepad.config();return false">Configure Gamepad</a>
      <span id="gamepadText"></span>
      <script src="js/gameboy.js"></script>
    </div>
    
  </body>
</html>
